package com.ruoyi.member.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.member.mapper.FamilyAudioMapper;
import com.ruoyi.member.domain.FamilyAudio;
import com.ruoyi.member.service.IFamilyAudioService;

/**
 * 家庭音频Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class FamilyAudioServiceImpl implements IFamilyAudioService 
{
    @Autowired
    private FamilyAudioMapper familyAudioMapper;

    /**
     * 查询家庭音频
     * 
     * @param id 家庭音频主键
     * @return 家庭音频
     */
    @Override
    public FamilyAudio selectFamilyAudioById(Long id)
    {
        return familyAudioMapper.selectFamilyAudioById(id);
    }

    /**
     * 查询家庭音频列表
     * 
     * @param familyAudio 家庭音频
     * @return 家庭音频
     */
    @Override
    public List<FamilyAudio> selectFamilyAudioList(FamilyAudio familyAudio)
    {
        return familyAudioMapper.selectFamilyAudioList(familyAudio);
    }

    /**
     * 新增家庭音频
     * 
     * @param familyAudio 家庭音频
     * @return 结果
     */
    @Override
    public int insertFamilyAudio(FamilyAudio familyAudio)
    {
        familyAudio.setCreateTime(DateUtils.getNowDate());
        return familyAudioMapper.insertFamilyAudio(familyAudio);
    }

    /**
     * 修改家庭音频
     * 
     * @param familyAudio 家庭音频
     * @return 结果
     */
    @Override
    public int updateFamilyAudio(FamilyAudio familyAudio)
    {
        familyAudio.setUpdateTime(DateUtils.getNowDate());
        return familyAudioMapper.updateFamilyAudio(familyAudio);
    }

    /**
     * 批量删除家庭音频
     * 
     * @param ids 需要删除的家庭音频主键
     * @return 结果
     */
    @Override
    public int deleteFamilyAudioByIds(Long[] ids)
    {
        return familyAudioMapper.deleteFamilyAudioByIds(ids);
    }

    /**
     * 删除家庭音频信息
     * 
     * @param id 家庭音频主键
     * @return 结果
     */
    @Override
    public int deleteFamilyAudioById(Long id)
    {
        return familyAudioMapper.deleteFamilyAudioById(id);
    }
}
